import request from '@/utils/request'

// 查询充值优惠列表
export function listRecharge(query) {
  return request({
    url: '/qipairoom/recharge/list',
    method: 'get',
    params: query
  })
}

// 查询充值优惠详细
export function getRecharge(couponId) {
  return request({
    url: '/qipairoom/recharge/' + couponId,
    method: 'get'
  })
}

// 新增充值优惠
export function addRecharge(data) {
  return request({
    url: '/qipairoom/recharge',
    method: 'post',
    data: data
  })
}

// 修改充值优惠
export function updateRecharge(data) {
  return request({
    url: '/qipairoom/recharge',
    method: 'put',
    data: data
  })
}

// 删除充值优惠
export function delRecharge(couponId) {
  return request({
    url: '/qipairoom/recharge/' + couponId,
    method: 'delete'
  })
}


//停用
export function stopCoupon(data) {
  return request({
    url: '/qipairoom/recharge/stop',
    method: 'post',
    data: data
  })
}
//启用
export function useCoupon(data) {
  return request({
    url: '/qipairoom/recharge/use',
    method: 'post',
    data: data
  })
}